package com.study.design.pattern.pattern.structural.facade;

/**
 * @Author: gongsl
 * @Date: 2025-03-09 11:53
 * @description: 商品对应的RPC实现类
 */
public class ProductFacadeImpl implements ProductFacade {

    private StockServiceImpl stockService = new StockServiceImpl();
    private LogisticsServiceImpl logisticsService = new LogisticsServiceImpl();

    /**
     * 下单商品
     */
    @Override
    public Boolean orderGoods(ProductInfo productInfo) {
        System.out.println("用户已下单!");
        stockService.abateStock(productInfo);
        logisticsService.deliverGoods(productInfo);
        return true;
    }
}
